#ifndef ULA_H_
#define ULA_H_

#include "Flags.h"

typedef unsigned short int u16bits;

class ULA
{
public:
	ULA();
	virtual ~ULA();
	static void ExecutaOperacao(int operando, u16bits ra, u16bits rb, u16bits &c, Flags *flags);
private:
	//carrega Registrador
	//static int CarregaRegistrador(Registradores reg,int pos);
	//operacoes
	static unsigned short Zeros(Flags *flags);
	static unsigned short And(unsigned short ra,unsigned short rb, Flags *flags);
	static unsigned short AndNota(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short Passa(unsigned short c,Flags *flags);
	static unsigned short Xor(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short Or(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short Nor(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short Xnor(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short PassNota(unsigned short c,Flags *flags);
	static unsigned short OrNotb(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short Nand(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short Ones(Flags *flags);
	static unsigned short Add (unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short AddInc(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short IncA(unsigned short ra,Flags *flags);
	static unsigned short SubDec(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short Sub(unsigned short ra,unsigned short rb,Flags *flags);
	static unsigned short DecA(unsigned short ra,Flags *flags);
	static unsigned short Lsl(unsigned short ra,Flags *flags);
	static unsigned short Lsr(unsigned short ra,Flags *flags);
	static unsigned short Asr(unsigned short ra,Flags *flags);
	static unsigned short Asl(unsigned short ra,Flags *flags);
};

#endif /*ULA_H_*/
